/* 移动端专用样式 */

/* 安全区域适配 */
:root {
  --safe-area-inset-top: env(safe-area-inset-top);
  --safe-area-inset-right: env(safe-area-inset-right);
  --safe-area-inset-bottom: env(safe-area-inset-bottom);
  --safe-area-inset-left: env(safe-area-inset-left);
}

/* 移动端基础样式 */
@media (max-width: 768px) {
  /* 全局字体大小调整 */
  html {
    font-size: 14px;
  }
  
  /* 触摸优化 */
  button, .el-button {
    min-height: 44px !important;
    min-width: 44px !important;
  }
  
  /* 输入框触摸优化 */
  input, .el-input__inner {
    min-height: 44px !important;
    font-size: 16px !important; /* 防止iOS自动缩放 */
  }
  
  /* 表格水平滚动 */
  .el-table {
    font-size: 12px !important;
  }
  
  .el-table .el-table__cell {
    padding: 8px 4px !important;
  }
  
  /* 卡片间距优化 */
  .el-card {
    margin: 8px !important;
    border-radius: 8px !important;
  }
  
  .el-card__body {
    padding: 16px !important;
  }
  
  /* 标签页优化 */
  .el-tabs__item {
    padding: 0 8px !important;
    font-size: 14px !important;
  }
  
  .el-tabs__content {
    padding: 16px 8px !important;
  }
  
  /* 表单优化 */
  .el-form-item {
    margin-bottom: 16px !important;
  }
  
  .el-form-item__label {
    line-height: 1.2 !important;
    padding-bottom: 4px !important;
  }
  
  /* 消息框适配 */
  .el-message-box {
    width: 90% !important;
    max-width: 400px !important;
  }
  
  /* 抽屉和对话框适配 */
  .el-drawer__body,
  .el-dialog__body {
    padding: 16px !important;
  }
}

/* 手机横屏适配 */
@media (max-width: 768px) and (orientation: landscape) {
  .mobile-header {
    height: 50px !important;
  }
  
  .mobile-header h1 {
    font-size: 18px !important;
  }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
  .el-card {
    margin: 4px !important;
  }
  
  .el-table {
    font-size: 11px !important;
  }
  
  .el-button--small {
    font-size: 11px !important;
    padding: 6px 8px !important;
  }
}

/* 移动端容器类 */
.mobile-container {
  padding: var(--safe-area-inset-top) var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-content {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

@media (min-width: 576px) {
  .mobile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 移动端按钮组 */
.mobile-button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-button-group .el-button {
  flex: 1;
  min-width: 0;
}

/* 移动端统计卡片 */
.mobile-stat-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.mobile-stat-value {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 4px;
}

.mobile-stat-label {
  font-size: 12px;
  color: #666;
}

/* 移动端表单样式 */
.mobile-form {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin: 8px 0;
}

.mobile-form .el-form-item__label {
  font-weight: 500;
  color: #333;
}

/* 移动端导航 */
.mobile-nav {
  display: flex;
  justify-content: space-around;
  background: white;
  border-top: 1px solid #eee;
  padding: 8px 0;
  position: sticky;
  bottom: 0;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  color: #666;
  text-decoration: none;
  font-size: 12px;
}

.mobile-nav-item.active {
  color: #667eea;
}

/* 滑动操作 */
.mobile-swipe-action {
  position: relative;
  overflow: hidden;
}

/* 触摸反馈 */
.mobile-touch-feedback {
  position: relative;
  overflow: hidden;
}

.mobile-touch-feedback::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.mobile-touch-feedback:active::before {
  width: 200px;
  height: 200px;
}

/* 加载状态 */
.mobile-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  color: #666;
}

/* 空状态 */
.mobile-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

/* 移动端表格滚动容器 */
.mobile-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-table-container::-webkit-scrollbar {
  height: 4px;
}

.mobile-table-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* 固定底部操作栏 */
.mobile-bottom-actions {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 12px 16px;
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}


